<!--

Input : <photo ORM> $photo

-->
<div class="wall_comment">
    <!-- MAIN WALL -->
    <?php
        $user = new ORM('user');
        $user->find($photo->owner);
        $profpic = new ORM('photo');
        $profpic->find($user->photo_id);
        $categ = new ORM('photo_category');
        $categ->find($photo->category_id);
        $tags = $user->query("
            select user.* from user
            left join photo_tag on ( user.id = user_id )
            where photo_tag.photo_id = $photo->id
        ");
    ?>
    <img class="profpic" src="<?php echo URL::site($profpic->link) ?>" alt="<?php echo $user->username ?>" />
    <div class = "right">
        <div class="name">
            <a href="<?php echo URL::site("profile?uid=$user->id") ?>"><?php echo $user->username ?></a>
        </div>
        <div class="content">
            <?php echo $photo->description;  ?>
            <div>
                <br/>
                <?php
                $stemp = "";
                foreach ($tags as $tag) {
                    $stemp .=
                        '<a href="'. URL::site("profile?uid=$tag->id") .'">'
                        . $tag->username . '</a>, ';
                } 
                rtrim($stemp, ',');
                if($stemp != '') echo "Tag : " . $stemp;
                ?>

            </div>
        </div>
        <div class="datetime">
            Category: <?php echo $categ->name ?>
        </div>
        <div class="datetime">
            Keyword: <?php echo $photo->keyword; ?>
        </div>
        <div class="datetime">
            Taken: <?php echo $photo->date_pick; ?>
        </div>
        <div class="datetime">
            <?php echo $photo->date_stamp ?>
        </div>
    </div>
    <div class="clear"></div>
</div>